<?php
if (isset($_SESSION['lankesi']) && $_SESSION['lankesi'] > 0) {
	//$text = "".$_SESSION['lankesi']."<br />";
	$text='';
	$q = mysql_query1("SELECT `id`,`tid`,`pav` FROM `d_straipsniai` WHERE `d_straipsniai`.`last_data` >= ".escape($_SESSION['lankesi'])." ORDER BY `d_straipsniai`.`last_data` DESC LIMIT 0,5");
	if (mysql_affected_rows() > 0) {
		$text .= "<b>Forumų:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//http://85.232.143.6/nvs/?id,22;p,16;t,6
			$text .= "\t <img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,25;t,".$row['tid'].";s,".$row['id']."#end'>".$row['pav']."</a><br />\n";
		}
	}

	$q = mysql_query1("SELECT id, pid, pav, t_text FROM straipsniai WHERE date>=".escape($_SESSION['lankesi'])." LIMIT 10");
	if (mysql_affected_rows() > 0) { 
	$text .= "<hr/><b>Straipsnių:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//http://85.232.143.6/nvs/?id,22;p,16;t,6
			$text .= "<img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,22;p,".$row['pid'].";t,".$row['id']."'>".$row['pav']."</a><br />\n";
		}
	}
	$q = mysql_query1("SELECT `naujienos`.`id`, `naujienos`.`pavadinimas` FROM `naujienos` WHERE `naujienos`.`data`>=".escape($_SESSION['lankesi'])." LIMIT 10");
	if (mysql_affected_rows() > 0) { 
	$text .= "<hr/><b>Naujienų:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//index.php?id,50;k,22
			$text .= "<img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,50;k,".$row['id']."'>".$row['pavadinimas']."</a><br />\n";
		}
	}
	$q = mysql_query1("SELECT `codebin`.`id`, `codebin`.`pav` FROM `codebin` WHERE `codebin`.`data`>=".escape($_SESSION['lankesi'])." LIMIT 10");
	if (mysql_affected_rows() > 0) { 
	$text .= "<hr/><b>CodeBin:</b><br/>";
		while ($row = mysql_fetch_assoc($q)) {
			//index.php?id,50;k,22
			$text .= "<img src=\"images/icons/bullet2.gif\" alt=\"o\" class=\"middle\" border=\"0\"/> <a href='?id,7;c,".$row['id']."'>".$row['pav']."</a><br />\n";
		}
	}

	if (isset($text) && !empty($text)) { hide("Kas naujo svetainėje",$text); }
	unset($text);
}
?>